import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.text.JTextComponent;


@SuppressWarnings("serial")
public class Keyboard extends JFrame {
	public Keyboard(JTextComponent focusedField, int caretPosition) {
		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();

		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		
		setLayout(new XYLayout());

		setLocation(0, 0);
		setSize(dim);
		setUndecorated(true);

		setBackground(new Color(0, 0, 0, 0));

		Global.keyboardOpened = true;


		JPanel panel = new JPanel();
		panel.setPreferredSize(dim);
		panel.setOpaque(false);
		panel.setLayout(new XYLayout());
		add(panel);
		
		JPanel backgroundPanel = new JPanel();
		backgroundPanel.setOpaque(false);
		backgroundPanel.setLocation(Global.displayX*15/81, Global.displayY*54/81);
		panel.add(backgroundPanel);
		
		JPanel added = new OnScreenKeyboard(focusedField, caretPosition, false, backgroundPanel);
		backgroundPanel.add(added);
		
		

		setVisible(true);
		}
	


}
